home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QRZ! Ham Radio 4
/
QRZ Ham Radio Callsign Database - Volume 4.iso
/
files
/
dsp
/
drbubtxt
/
56100tar.z
/
56100tar
/
56100
/
source.2
< prev
Wrap
Text File
|
1992-04-28
|
6KB
|
196 lines
========================================================================
B.3 SECOND SET OF BENCHMARKS
========================================================================
B.3.1 Sine Wave Generation Using Double Integration Technique
clr b
move #$4000,a
move #0,n1
move #$4532,x1
move #$1,r1
move x0,y0
do y1,loop1
mac x0,b1,a b,x:(r1)+n1
mac -y0,a1,b
loop1
move b,x:(r1)
========================================================================
B.3.2 Sine Wave Generation Using Second Order Oscillator
clr a
move #$4000,x1
move #$6d4b,x0
move #$1,r1
move #0,n1
do y1,loop2
mac -x1,x0,a x1,x:(r1)+n1
neg a
mac x1,x0,a
tfr x1,a a,x1
loop2
move x1,x:(r1)
========================================================================
B.3.3 IIR Filter Using Cascaded Transpose BIQUAD Cell
move #w1,r0
move #w2,r1
move #N-1,m0
move m0,m1
move #0,n0
move #0,n1
move #c,r3
ori #08,mr
move x:(r0)+n0,b x:(r3)+,x0 ;b=w1;y0=b0/2
asr b ;b=w1/2
movep x:<<input,y0 ;y0=x
do #N,end_lp
macr y0,x0,b x:(r1)+n1,a x:(r3)+,x0 ;b=y/2;get w2,b1/2
asr a b,y1 ;a=w2/2;y1=y
mac x0,y0,a x:(r3)+,x0 ;a=x*b1/2+w2/2,get a1/2
macr x0,y1,a x:(r3)+,x0 ;a=w1/2;get b2/2
mpy x0,y0,a a,x:(r0)+ ;a=x*b2/2;save w1
move x:(r3)+,x0 b,y0 ;y0=y;get a2/2
macr y1,x0,a x:(r0)+n0,b x:(r3)+,x0 ;a=w2/2;get next w1, b0/2
asr b a,x:(r1)+ ;b=w1/2; save w2
end_lp
movep y0,x:<<output ;output y
========================================================================
B.3.4 IIR Filter Using The Nth Order Direct Form II Canonic
;The equation of the filter becomes:
; wn = a0*xn - a1*wn-1 - a2*wn-2........... - aN-1*wn-N
; yn = b0*wn +b1*wn-1 - b2*wn-2...........- bN-1*wn-N
move #c,r3
move #w,r0
move #N,m0
move #0,n0
movep x:<<input,y0 ;a=xn
clr a x:(r3)+,x1 ;y0=wn-1, x1=a1
rep #N-1
mac y0,x1,a x:(r0)+,y0 x:(r3)+,x1
macr y0,x1,a x:(r0)+,y0 x:(r3)+,x1
clr a a,x:(r0)+n0
move x:(r0)+,y0
rep #N-1
mac y0,x1,a x:(r0)+,y0 x:(r3)+,x1
macr y0,x1,a x:(r0)+,y0 x:(r3)+,x1
movep a,x:<<output ;output y
========================================================================
B.3.5 Find The Index Of A Maximum Value In An Array
move #AD,r0
move #-2,n1
clr a x:(r0)+,b
do #N,end_lp3
cmpm b,a
tle b,a r0,r1
move x:(r0)+,b
end_lp3
nop
lea (r1)+n1,r1
========================================================================
B.3.6 Proportional Integrator Differentiator (PID) Algorithm
;The PID is the most commonly used algorithm in control applications
;y(n) = y(n-1) + k0 x(n) + k1 x(n-1) + k2 x(n-2)
move #k,r3
move #s+2,r0
move #-1,n0
move #2,m0
movep x:<<input,x0
move x:(r0)+,b x:(r3)+,y0
mac x0,y0,b x:(r0)+,y0 x:(r3)+,x1
mac y0,x1,b x:(r0)+,y0 x:(r3)+,x1
macr y0,x1,b x0,x:(r0)+n0
move b,x:(r0)
movep b,x:<<output
========================================================================
B.3.7 Reed Solomon Main Loop
;n3=n1=-1
do #28,loopn
move x:(r0)+n0,y1 ;Get from interleave
move x:(r3)+n3,a ;get P4
eor y1,a b,x:(r1)+n1 ;alpha(a) store p2
move a,n1 ;Move ALPHA for table lookup
move x:tablebase,b ;tableptr in b
add b,a y1,x:(r2)+ ;table index (a);store sample
tfr x0,b x:(a1),y1 ;table entry y1;g1+base (b)
add y1,b ;table ptr(b)
tfr y0,a x:(b1),x1 ;alpha1(x1);g2+base(a)
add y1,a x:(r3)+,b ;table ptr(a);P3(b)
eor x1,b x:(a1),y1 ;p4(b),alpha2(a)
move x:(r1)-,a ;p2(a)
eor y1,a b,x:(r3)+n3 ;p3(a), store p4
move x:(r1),b ;p1(b)
eor x1,b a,x:(r3)+ ;Add ALPHA2+P2, s new P1
move n1,x:(r1)+ ;store p1
loopn
========================================================================
B.3.8 N Double Precision Real Multiplies
move #AD,r0
move #BD,r3
move #c,r1
move x:(r0)+,y0 x:(r3)+,x0
do #N,end_loop
move x:(r0)+,y1 x:(r3)+,x1
mpyuu x0,y0,a
move a0,x:(r1)+
dmacsu x1,y0,a
macsu y1,x0,a
dmacss y1,x1,a
move x:(r0)+,y0 x:(r3)+,x0
move a0,x:(r1)+
move a,x:(r1)+
end_loop
========================================================================
B.3.9 Double Precision Autocorrelation
; N: speech frame size
; p: LPC order
move #cor,r1
move #frame,r2
do #lpc+1,_loop1
move r2,r3
clr b
move #frame,r0
lua (r2)+,r2
move lc,x1
move #>N-(p+1),a
add x1,a x:(r0)+,y0 x:(r3)+,x0
rep a
mac y0,x0,b x:(r0)+,y0 x:(r3)+,x0
move b0,x:(r1)+
move b1,x:(r1)+
_loop1
========================================================================